package util;

import java.util.Comparator;

import model.ContactModel;

public class ComparatorAlpha  implements Comparator<Object>{

	@Override
	public int compare(Object o1, Object o2) {
		ContactModel c1 = (ContactModel)o1;
		ContactModel c2 = (ContactModel)o2;
		
		int flag = c1.getLastName().compareTo(c2.getLastName());
		if(flag == 0){
			return c1.getFirstName().compareTo(c2.getFirstName());
		}else{
			return flag;
		}
	}

}
